import request from '@/utils/request'

export function getFormKey(procDefId, taskDefKey) {
  const params = {
    procDefId: procDefId,
    taskDefKey: taskDefKey
  }
  return request({
    url: 'flowTask/form',
    method: 'get',
    params
  })
}
export function saveLeave(data) {
  return request({
    url: 'leave/startLeave',
    method: 'post',
    data
  })
}
export function findLeave(id) {
  return request({
    url: 'leave/findLeave/' + id,
    method: 'get'
  })
}
export function finishLeave(procInsId, taskDefKey, comment, taskId, operation) {
  const params = {
    procInsId: procInsId,
    taskDefKey: taskDefKey,
    comment: comment,
    taskId: taskId,
    operation: operation
  }
  return request({
    url: 'leave/finishLeave',
    method: 'post',
    params
  })
}

